{include file="public/header" /}
<aside id="sitecontent" class="transition">
    {include file="public/search" /}
    <!-- main -->
    <section class="tagBox dis-flex-center">
        <div class="box " style="width: 100%;">
            <h3 class="dis-flex-center-center">楼盘位置&nbsp;<span></span></h3>
            <ul>
                <a href="{:url('house/index')}" {empty name="area"}class="cur"{/empty}>全部</a>
                {volist name="area_list" id="item"}
                <a href="{:url('house/index', ['area'=>$item.area])}" {eq name="area" value="$item.area"}class="cur"{/eq}>{$item.area}</a>
                {/volist}
            </ul>
        </div>
    </section>
    <section class="index-hot p25-20 newsLst" style="padding-bottom: 0;">
        <ul class="dropLst">
            {volist name="data" id="item"}
            <li>
                <a href="{:url('house/detail', ['id'=>$item.id])}">
                    <div class="img position-relative">
                            <span class="dis-flex-center-center">服务<br>
                                {$item.custom_num}户</span>
                        <img src="{$item.thumb_url}" alt="{$item.name}" srcset="">
                        <div class="dis-flex-center-center line-one">{$item.name}</div>
                    </div>
                    <div class="txt dis-flex-center-center">
                        已竣工{$item.completed_num}户 | 已签约{$item.start_num}户
                    </div>
                </a>
            </li>
            {/volist}
        </ul>
    </section>
    <!-- main end-->
    {include file="public/footer" /}
<script type="text/javascript">
    var tab1LoadEnd = false;
    var page=2;
    var area = "{$area}"
    var dropload = $('.newsLst').dropload({
        scrollArea : window,
        loadDownFn : function(me){
            // 加载菜单一的数据
            $.ajax({
                type: "POST",
                url: "{:url('house/getDataList')}",
                data: {page:page, area:area},
                dataType: 'json',
                success: function(data){
                    if (data.code == 0){
                            var str = '';
                            $.each(data.data, function(i, vo) {
                                var pic = vo.thumb_url || '/static/mobile/images/hot-img.jpg';
                                str += '<li>'
                                    +'<a href="'+vo.linkurl+'">'
                                    +'<div class="img position-relative">'
                                    +'<span class="dis-flex-center-center">服务<br>'+vo.custom_num+'户</span>'
                                    +'<img src="'+pic+'" alt="" srcset="">'
                                    +'<div class="dis-flex-center-center line-one">'+vo.name+'</div>'
                                    +'</div>'
                                    +'<div class="txt dis-flex-center-center">已竣工'+vo.completed_num+'户 | 已签约'+vo.start_num+'户</div>'
                                    +'</a>'
                                    +'</li>';

                            });
                            $('.dropLst').append(str);
                            if(data.total_page > page){
                                page++;
                            }else{
                                tab1LoadEnd = true; // 数据加载完
                                me.lock(); // 锁定
                                me.noData(); // 无数据
                            }
                            me.resetload(); // 每次数据加载完，必须重置
                    }else{
                        myLayMsg(data.msg);
                    }
                },
                error: function(xhr, type){
                    myLayMsg('Ajax error!');
                    me.resetload(); // 即使加载出错，也得重置
                }
            });
            // 加载菜单二的数据
        }
    });
</script>